package com.wythe.mall.adapter;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.wythe.mall.R;

import java.util.ArrayList;

import de.hdodenhof.circleimageview.CircleImageView;
import top.yokey.base.bean.EvaluateGoodsBean;

public class EvaluateGoodsListAdapter extends RecyclerView.Adapter<EvaluateGoodsListAdapter.ViewHolder> {

    private final ArrayList<EvaluateGoodsBean> arrayList;
    private OnItemClickListener onItemClickListener;

    public EvaluateGoodsListAdapter(ArrayList<EvaluateGoodsBean> arrayList) {
        this.arrayList = arrayList;
        this.onItemClickListener = null;
    }

    @Override
    public int getItemCount() {
        return 6;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup group, int viewType) {
        View view = LayoutInflater.from(group.getContext()).inflate(R.layout.item_goods_evaluate, group, false);
        return new ViewHolder(view);
    }

    public void setOnItemClickListener(OnItemClickListener listener) {
        this.onItemClickListener = listener;
    }

    public interface OnItemClickListener {
        void onClick(int position, EvaluateGoodsBean bean);
    }

    class ViewHolder extends RecyclerView.ViewHolder {
        private CircleImageView mCircleImageView;
        private TextView mName;
        private TextView mEvaluate;
        private TextView mDate;
        private TextView mDes;
        public ViewHolder(View view) {
            super(view);
            mCircleImageView = view.findViewById(R.id.user_img_view);
            mName = view.findViewById(R.id.tv_name);
            mEvaluate = view.findViewById(R.id.tv_evaluate);
            mDate = view.findViewById(R.id.tv_time);
            mDes = view.findViewById(R.id.tv_des);
        }

    }

}
